﻿using Ardalis.Specification;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace HuaweiCloud.Dotnet.Samples.Common
{
    public interface IApplicationService<T>
    {
        Task AddAsync(T t, CancellationToken token = default);
        Task DeleteAsync<TID>(TID id, CancellationToken token = default) where TID : notnull;
        Task UpdateAsync(T t, CancellationToken token = default);
        Task<T?> GetAsync<TID>(TID id, CancellationToken token = default) where TID : notnull;
        Task<IList<T>> ListAsync(ISpecification<T>? specification = null, CancellationToken token = default);
    }
}
